{extend name="public/base" /}
{block name="body"}
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">管理员列表</div>
            <div class="layui-card-body">
                <div class="layui-row zz-row-operate">
                    <div class="zz-operate-btn-group">
                        <a class="layui-btn open-win" title="新增管理员" win-width="500" win-height="360" href="{:url('add')}">新 增</a>
                        <a class="layui-btn layui-btn-danger zz-btn-delete-all" href="{:url('del')}">批量删除</a>
                    </div>
                    <form action="{:url('')}" class="layui-form zz-form-search zz-form zz-form-right">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="nickname" placeholder="请输入用户名或昵称" value="{$nickname}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn" lay-submit>
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                            </button>
                        </div>
                    </form>
                </div>

                <div class="layui-form">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th class=" layui-table-col-special" width="18px">
                                <input type="checkbox" lay-filter="zz-checkbox-table" lay-skin="primary">
                            </th>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>昵称</th>
                            <th>最后登录时间</th>
                            <th>最后登录IP</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="lists" id="vo"}
                        <tr>
                            <td><input type="checkbox" class="zz-table-chk-item" value="{$vo.id}" lay-skin="primary"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.username}</td>
                             <td>{$vo.nickname}</td>
                            <td>
                                {eq name="vo.last_login_time" value="0"}
                                    	暂未登录
                                    {else/}
                                    {:date('Y-m-d H:i:s',$vo.last_login_time)}
                                {/eq}

                            </td>
                            <td>
                                {eq name="vo.last_login_ip" value="0"}
                                    	暂未登录
                                    {else/}
                                    {$vo.last_login_ip}
                                {/eq}

                            </td>
                            <td>
                                <input type="checkbox" lay-filter="zz-switch-display" data-href="{:url('set_status?id='.$vo['id'])}" name="status" value="{$vo.status}" {$vo.status==1?'checked':''} lay-skin="switch" lay-text="启用|禁用">
                            </td>
                            <td>
                            	{if UID==1}
                            	<a href="{:url('resetpwd?id='.$vo['id'])}" win-width="500" win-height="255" class="layui-btn layui-btn-xs open-win" title="重置密码">重置密码</a>
                            	{/if}
                                <a href="{:url('auth?id='.$vo['id'])}" class="layui-btn layui-btn-xs layui-btn-normal open-win" title="授权">授权</a>
                                <a href="{:url('del?ids='.$vo['id'])}" class="layui-btn layui-btn-danger layui-btn-xs confirm ajax-post">删除</a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    {$page|raw}
                </div>
            </div>
        </div>
    </div>
</div>
{/block}